﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Extraxt HTML</title>
    <link href="Styles/js-console.css" rel="stylesheet" />
    <script src="Scripts/isValidInput.js"></script>
</head>
<body>
    <div id="task">
        <p>Write a function that extracts the content of a html page given as text. The function should return anything that is in a tag, without the tags:</p>
        <a href="5.html">Previous task</a>
        <a href="7.html">Next task</a>
    </div>

    <br />
    <button onclick="ExtractHTML()">Run script</button>

    <div id="js-console"></div>
    <script src="Scripts/js-console.js"></script>

    <script>
        function ExtractHTML() {
            var htmlText = "<html><head><title>Sample site</title></head><body><div>text<div>more text</div>and more...</div>in body</body></html>"
            htmlText = htmlText.replace(/<[^>]+>/g, "");
            jsConsole.writeLine(htmlText);
        }
    </script>
</body>
</html>
